home *** CD-ROM | disk | FTP | other *** search
- WiseStampJoint.prototype = new Object();
- WiseStampJoint.prototype.call = WiseStampJoint_call;
-
- function WiseStampJoint(expectedCalls, callback) {
- this._expectedCalls = expectedCalls;
-
- this._results = []
- this._calls = [];
- for (var i=0; i<expectedCalls; i++) {
- this._calls[i] = false;
- this._results[i] = false;
- };
-
- this._callback = callback;
-
- if (expectedCalls <= 0) {
- this._callback.apply(null, this._results);
- };
- }
-
- function WiseStampJoint_call(index, value) {
- if (!this._calls[index]) {
- this._expectedCalls --;
- this._calls[index] = true;
- this._results[index] = value;
- };
-
- if (this._expectedCalls <= 0) {
- this._callback.apply(null, this._results);
- };
- }